<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> - Bootstrap3 Markdown编辑器</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="css/plugins/markdown/bootstrap-markdown.min.css" />
    <link href="css/style.css?v=4.1.0" rel="stylesheet">

</head>

<body>
<div class="col-sm-6">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>评委更改密码</h5>
        </div>
        <div class="ibox-content">

           <%-- id改成form1；action是评委控制器--%>
            <form class="form-horizontal m-t" id="form1" action="jurypass.action" method="post">
                <div class="form-group">
                    <label class="col-sm-3 control-label">旧密码：</label>
                    <div class="col-sm-8">
                        <%--id与name都是oldpass--%>
                        <input id="oldpass" name="oldpass" class="form-control" type="password">
                        <p style="color: #ff0000 ;font-weight:bold">${mess}</p>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">新密码：</label>
                    <div class="col-sm-8">
                        <%--id与name都是newpass--%>
                        <input id="newpass" name="newpass" class="form-control" type="password">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-3 control-label">确认密码：</label>
                    <div class="col-sm-8">
                        <%--id与name都是repass--%>
                        <input id="repass" name="repass" class="form-control" type="password">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 请再次输入您的密码</span>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-8 col-sm-offset-3">
                      <%-- type是button;onclick没问题--%>
                        <button class="btn btn-primary"  type="button" onclick="myfun1()">提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>

<!-- 自定义js -->
<script src="js/content.js?v=1.0.0"></script>

<!-- simditor -->
<script type="text/javascript" src="js/plugins/markdown/markdown.js"></script>
<script type="text/javascript" src="js/plugins/markdown/to-markdown.js"></script>
<script type="text/javascript" src="js/plugins/markdown/bootstrap-markdown.js"></script>
<script type="text/javascript" src="js/plugins/markdown/bootstrap-markdown.zh.js"></script>
<script type="text/javascript">
    function myfun1(){
        var newpass=$("#newpass").val();
        var oldpass=$("#oldpass").val();
        var repass=$("#repass").val();
        console.log(oldpass);
        console.log(newpass);
        console.log(repass);
        if(newpass==""){
            alert("新密码不能为空");
            return ;
        }
        if(oldpass==""){
            alert("旧密码不能为空");
            return ;
        }
        if(newpass!=repass){
            alert("密码与确认密码不一致");
            return ;
        }
        $("#form1").submit();
    }
</script>



</body>

</html>

